function banner(){
    number = number+1
    order_num = order_num+1
    imgNumber = imgNumber+1
    custom.push({number:number,order_num:order_num,type:1})
    for(let index in custom){
        if(custom[index].number == number){
            custom[index].ionrange_1 = 0
            custom[index].ionrange_2 = 100
            custom[index].ionrange_3 = 200
            custom[index].ionrange_4 = 0
            custom[index].img = []
            var imgList = {imgNumber:imgNumber,imgeSrc:'',urlType:0,urlId:0,urlTitle:''}
            custom[index].img.push(imgList)
        }
    }
    var html = ' <div class="form-group draggable dropped ui-draggable" id="dropped_'+number+'" data-number="'+number+'">\n' +
        '<div class="carousel slide">\n' +
        '                            <div class="carousel-inner">\n' +
        '                                <div style="display: flex; justify-content: center" class="item active">\n' +
        '                                    <img style="width: 100%; height: 200px;" alt="image" class="img-responsive" src="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2710640311,2174739898&fm=26&gp=0.jpg">\n' +
        '                                </div>\n' +
        '                            </div>\n' +
        '                        </div>'
    '        </div>'
    var img = $('#field_image').html()
    //隐藏所有
    $('#sortable_leve').find('div[class="level_number"]').css("display","none")
    var level = '<div class="level_number" style="width: 90%; position: relative" id="level_'+number+'" data-number="'+number+'">\n' +
        '<i style="position: absolute;right:-70px; top:-9px;font-size: 25px; cursor: pointer" class="fa fa-times LunboListClick"></i>\n' +
        ' <div class="m-b-sm m-t">\n' +
        '                            <small><strong>上边距</strong></small>\n' +
        '                        </div>\n' +
        '                        <div class="ionrange_1" data-number="'+number+'" ></div>\n' +
        ' <div class="m-b-sm m-t">\n' +
        '                            <small><strong>宽度调试</strong></small>\n' +
        '                        </div>\n' +
        '                        <div class="ionrange_2" data-number="'+number+'" ></div>\n' +
        ' <div class="m-b-sm m-t">\n' +
        '                            <small><strong>高度调试</strong></small>\n' +
        '                        </div>\n' +
        '                        <div class="ionrange_3" data-number="'+number+'"></div>\n' +
        ' <div class="m-b-sm m-t">\n' +
        '                            <small><strong>圆角</strong></small>\n' +
        '                        </div>\n' +
        '                        <div class="ionrange_4" data-number="'+number+'" ></div>\n' +
        '                            <div id="level_numberBox_'+number+'">\n' +
        '<div style="background: #f8f8f8;padding: 10px;border-radius: 10px" class="form-group  row additional">\n' +
        '<div class=" col-sm-4" style="margin-top:.5em;">\n' +
        '      <img src="" onerror="this.src=\'./resource/images/nopic.jpg\'; this.title=\'图片未找到.\'" class="img-responsive img-thumbnail" width="150">\n' +
        '    </div>\n' +
        '<div class="col-sm-8">\n' +
        '                                <div style="margin-bottom: 20px;position: relative;" class="input-group m-b">\n' +
        '                                    <input style="flex:3" type="text" id="bannerUrl_'+number+'_'+imgNumber+'" value="" class="form-control" readonly>\n' +
        '                                    <span style="flex:1" class="input-group-btn"> <button type="button" class="btn btn-default" data-imgNumber="'+imgNumber+'" data-number="'+number+'" onclick="bannerUrlClick($(this))">选择链接</button> </span>\n' +
        '                                </div>\n' +
        '                              '+img+'      \n' +
        '                            </div>\n' +
        '                            <div class="hr-line-dashed"></div></div>\n' +
        '                            </div>\n' +
        '<a class="btn btn-w-m btn-default" href="javascript:void(0)" onclick="AddImageClick('+number+')">添加下一个</a>\n' +
        '                        </div>'


    $('#sortable').append(html);
    $('#sortable_leve').append(level);

    $(".ionrange_1").ionRangeSlider({
        min: 0,
        max: 100,
        type: "single",
        step: 1,
        postfix: "px",
        prettify: false,
        hasGrid: true,
        from: 0,
        onChange:function (obj) {
            $("#dropped_"+obj.input.context.dataset.number+"").find("img").css("margin-top",obj.fromNumber)
            for(let index in custom){
                if(custom[index].number == obj.input.context.dataset.number){
                    custom[index].ionrange_1 = obj.fromNumber
                }
            }

        }
    });
    $(".ionrange_2").ionRangeSlider({
        min: 0,
        max: 100,
        type: "single",
        step: 1,
        postfix: "%",
        prettify: false,
        hasGrid: true,
        from: 100,
        onChange:function (obj) {
            $("#dropped_"+obj.input.context.dataset.number+"").css("width",obj.fromNumber+"%")
            for(let index in custom){
                if(custom[index].number == obj.input.context.dataset.number){
                    custom[index].ionrange_2 = obj.fromNumber
                }
            }

        }
    });
    $(".ionrange_3").ionRangeSlider({
        min: 0,
        max: 1000,
        type: "single",
        step: 1,
        postfix: "px",
        prettify: false,
        hasGrid: true,
        from: 200,
        onChange:function (obj) {
            $("#dropped_"+obj.input.context.dataset.number+"").find("img").css("height",obj.fromNumber+"px")
            for(let index in custom){
                if(custom[index].number == obj.input.context.dataset.number){
                    custom[index].ionrange_3 = obj.fromNumber
                }
            }
        }
    });
    $(".ionrange_4").ionRangeSlider({
        min: 0,
        max: 100,
        type: "single",
        step: 1,
        postfix: "px",
        prettify: false,
        hasGrid: true,
        from: 0,
        onChange:function (obj) {
            $("#dropped_"+obj.input.context.dataset.number+"").find("img").css("borderRadius",obj.fromNumber+"px")
            for(let index in custom){
                if(custom[index].number == obj.input.context.dataset.number){
                    custom[index].ionrange_4 = obj.fromNumber
                }
            }
        }
    });
}
function AddImageClick (num) {
    imgNumber = imgNumber+1
    var AddimgPar = $('#level_numberBox_'+num+'')
    var img = $('#field_image').html()
    var Addimg = '<div style="background: #f8f8f8;padding: 10px;border-radius: 10px" class="form-group  row additional">\n' +
        '<div class=" col-sm-4" style="margin-top:.5em;">\n' +
        '      <img src="" onerror="this.src=\'./resource/images/nopic.jpg\'; this.title=\'图片未找到.\'" class="img-responsive img-thumbnail" width="150">\n' +
        '    </div>\n' +
        '<div class="col-sm-8">\n' +
        '                                <div style="margin-bottom: 20px;position: relative;" class="input-group m-b">\n' +
        '<i style="position: absolute;right:-18px; z-index: 999; top:-17px;font-size: 25px; cursor: pointer" data-imgNumber="'+imgNumber+'"  data-number="'+num+'" class="fa fa-times-circle DetailClick"></i>\n' +
        '                                    <input style="flex:3" type="text" id="bannerUrl_'+num+'_'+imgNumber+'" value="" class="form-control" readonly>\n' +
        '                                    <span style="flex:1" class="input-group-btn"> <button type="button" class="btn btn-default" data-imgNumber="'+imgNumber+'"  data-number="'+num+'" onclick="bannerUrlClick($(this))">选择链接</button> </span>\n' +
        '                                </div>\n' +
        '                              '+img+'      \n' +
        '                            </div>\n' +
        '                            <div class="hr-line-dashed"></div></div>\n' +
        '                            </div>'

    AddimgPar.children("div:last-child").after(Addimg)
    var imgList = {imgNumber:imgNumber,imgeSrc:'',urlType:0,urlId:0,urlTitle:''}
    for(let index in custom){
        if(custom[index].number == num){
            custom[index].img.push(imgList)
        }
    }

}
